import logging,yagmail

def get_log():
    logging.basicConfig(level=logging.DEBUG,filename='log.txt',format='%(levelname)s->%(message)s')
    loger=logging.getLogger()
    return loger

def send_email(log,html):
    send=yagmail.SMTP(user='1418953961@qq.com',password='flmhycefgeagbadj',host='smtp.qq.com')
    send.send(to='1418953961@qq.com',subject='图书系统测试报告',contents='正文',attachments=[log,html])